package com.liao.servlet;

import com.liao.entity.Top10Patient;
import com.liao.service.Top10CategoryService;
import com.liao.service.Top10PatientService;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;

@WebServlet("/top10Patient")
public class Top10PatientServlet extends HttpServlet {
    @Override
    public void service(ServletRequest req, ServletResponse response) throws ServletException, IOException {
        Top10PatientService service=new Top10PatientService();
        String json=service.findAll();
        //2.响应结果
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().write(json);
    }
}
/*

[{"taskId":"1","categoryId":2,"patientId":"3","clickCount":100},{"taskId":"4","categoryId":5,"patientId":"6","clickCount":200},{"taskId":"7","categoryId":8,"patientId":"9","clickCount":300},{"taskId":"10","categoryId":11,"patientId":"12","clickCount":400},{"taskId":"13","categoryId":14,"patientId":"15","clickCount":500},{"taskId":"16","categoryId":17,"patientId":"18","clickCount":600},{"taskId":"19","categoryId":20,"patientId":"21","clickCount":700},{"taskId":"22","categoryId":23,"patientId":"24","clickCount":800},{"taskId":"3","categoryId":14,"patientId":"7","clickCount":900},{"taskId":"9","categoryId":9,"patientId":"9","clickCount":999}]

 */